home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 March
/
EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso
/
earcd
/
comm2
/
amislt14.lha
/
AmiSlate
/
ExampleRexx
/
boxme.rexx
next >
Wrap
OS/2 REXX Batch file
|
1996-01-27
|
2KB
|
67 lines
/* BoxMe.rexx
An ARexx script designed to work with AmiSlate.
Draws a box around the current mouse position whenever the user
presses or lets go of the left mouse button in the drawing window.
*/
parse arg CommandPort ActiveString
if (length(CommandPort) == 0) then do
say ""
say "Usage: rx boxme.rexx <REXXPORTNAME>"
say " (REXXPORTNAME is usually AMISLATE)"
say ""
say "Or run from the Rexx menu within AmiSlate."
say ""
exit 0
end
address (CommandPort)
options results
/* Constants for use with AmiSlate's ARexx interface */
AMessage.TIMEOUT = 1 /* No events occurred in specified time period */
AMessage.MESSAGE = 2 /* Message recieved from remote Amiga */
AMessage.MOUSEDOWN = 4 /* Left mouse button press in drawing area */
AMessage.MOUSEUP = 8 /* Left mouse button release in drawing area */
AMessage.RESIZE = 16 /* Window was resized--time to redraw screen? */
AMessage.QUIT = 32 /* AmiSlate is shutting down */
AMessage.CONNECT = 64 /* Connection established */
AMessage.DISCONNECT = 128 /* Connection broken */
AMessage.TOOLSELECT = 256 /* Tool Selected */
AMessage.COLORSELECT = 512 /* Palette Color selected */
AMessage.KEYPRESS = 1024 /* Key pressed */
PenDown = 0
do while (1=1)
WaitEvent 5 MOUSEDOWN MOUSEUP QUIT stem e.
t = e.type
if (t = AMessage.MOUSEDOWN) then do
setfpen 7
square e.x-5 e.y-5 e.x+5 e.y+5
PenDown = 1
end
if (t = AMessage.MOUSEUP) then do
setfpen 1
square e.x-5 e.y-5 e.x+5 e.y+5
PenDown = 0
end
if (t = AMessage.QUIT) then exit
if ((t = AMessage.TIMEOUT)&(PenDown = 1)) then do
setfpen 2
square e.x-5 e.y-5 e.x+5 e.y+5
end
e.type = 0
end